// data.cpp
// Copyright (C) 2008 Sam Bateman
// samuel.bateman@gmail.com
//
// This file is part of DVD On Fire.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

//! @file data.cpp
//! @author Sam Bateman
//! @brief Source file for the Data class.

#include <cstdio>
#include <string>
#include <libdvdonfire/config.h>
#include <libdvdonfire/log.h>
#include "data.h"
using namespace dvdonfire::lib;
using namespace std;

namespace dvdonfire
{
    namespace daemon
    {
        // struct Data::Impl {{{
        struct Data::Impl
        {
            Config *config;
            Log    *log;
        };
        // }}}
        // Data::Data {{{
        //! @brief Constructor.
        Data::Data()
        {
            impl = new Impl;
            impl->config = new Config;
            impl->log = new Log(impl->config->get("confdir") + "log/");
        }
        // }}}
        // Data::~Data() {{{
        //! @brief Destructor.
        Data::~Data()
        {
            delete impl->config;
            delete impl->log;
            delete impl;
        }
        // }}}
        // Data::getConfig() {{{
        //! @brief Returns configuration information.
        //! @return Instance of Config.
        Config* Data::getConfig()
        {
            return impl->config;
        }
        // }}}
        // Data::getLog() {{{
        //! @brief Returns logging system.
        //! @return Instance of Log.
        Log* Data::getLog()
        {
            return impl->log;
        }
        // }}}
    }
}
